<div ng-controller="FaretempCtrl" ng-init="addAction()" class="sui-form form-horizontal">
    <form name="faretemplateForm" novalidate ng-submit="faretempAdd()">
        <ul class="sui-breadcrumb">
            <li><a href="#/faretemp/list">{{'freight' | translate}}{{'List'| translate}}</a></li>
            <li class="active">{{faretemplate.pid?'edit':'add_new' | translate}}</li>
        </ul>
        <div class="control-group" ng-if="faretemplate.pid">
            <label class="control-label v-top"><b style="color: #f00;">*</b> {{'productid' | translate}}:</label>
            <div class="controls">
                {{faretemplate.pid}}
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top"><b style="color: #f00;">*</b> {{'Name' | translate}} :</label>
            <div class="controls">
                <input type="text" name="name" ng-model="faretemplate.name"  class="input-xlarge">
                <div ng-show="faretemplateForm.name.$error.required" class="sui-msg msg-error msg-clear help-block">
                    <div class="msg-con">{{'required'| translate}}</div>
                    <s class="msg-icon"></s>
                </div>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top"><b style="color: #f00;">*</b> {{'shop_address' | translate}} :</label>
            <div class="controls">
                <input type="text" name="shop_addr" ng-model="faretemplate.shop_addr" class="input-xlarge" required>
                <!-- <input type="text" name="productcat_id" ng-model="product.productcat_id"  class="input-xlarge"> -->
                <div ng-show="faretemplateForm.shop_addr.$error.required" class="sui-msg msg-error msg-clear help-block">
                    <div class="msg-con">{{'required'| translate}}</div>
                    <s class="msg-icon"></s>
                </div>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top"><b style="color: #f00;">*</b> {{'dispatch_time' | translate}} :</label>
            <div class="controls">
                <input datetimepicker name="dispatch_time" ng-model="faretemplate.dispatch_time"  class="input-xlarge">
                <div ng-show="faretemplateForm.dispatch_time.$error.required" class="sui-msg msg-error msg-clear help-block">
                    <div class="msg-con">{{'required'| translate}}</div>
                    <s class="msg-icon"></s>
                </div>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top"><b style="color: #f00;">*</b> {{'is_incl_postage' | translate}} :</label>
            <div class="controls">
                <input type="checkbox" name="is_incl_postage" ng-model="faretemplate.is_incl_postage"  class="input-xlarge">
                <div ng-show="faretemplateForm.is_incl_postage.$error.required" class="sui-msg msg-error msg-clear help-block">
                    <div class="msg-con">{{'required'| translate}}</div>
                    <s class="msg-icon"></s>
                </div>
            </div>
        </div>
         <div class="control-group">
            <label class="control-label v-top"><b style="color: #f00;">*</b> {{'valuation_model' | translate}} :</label>
            <div class="controls">
            <valuation-type ng-model="faretemplate.valuation_model"></valuation-type>
                           <!-- <valuation-type ng-model="faretemplate.valuation_model"></valuation-type> -->
                <div ng-show="faretemplateForm.valuation_model.$error.required" class="sui-msg msg-error msg-clear help-block">
                    <div class="msg-con">{{'required'| translate}}</div>
                    <s class="msg-icon"></s>
                </div>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top"><b style="color: #f00;">*</b> {{'is_incl_postage_byif' | translate}} :</label>
            <div class="controls">
                <input type="checkbox" name="is_incl_postage_byif" ng-model="faretemplate.is_incl_postage_byif" class="input-xlarge"/>   
                 <div ng-show="faretemplateForm.is_incl_postage_byif.$error.required" class="sui-msg msg-error msg-clear help-block">
                    <div class="msg-con">{{'required'| translate}}</div>
                    <s class="msg-icon"></s>
                </div>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top"><b style="color: #f00;">*</b> {{'remark' | translate}} :</label>
            <div class="controls">
                 <input type="text" name="remark" class="input-xlarge"   ng-model="faretemplate.remark"/>
              
                <div ng-show="faretemplateForm.remark.$error.required" class="sui-msg msg-error msg-clear help-block">
                    <div class="msg-con">{{'required'| translate}}</div>
                    <s class="msg-icon"></s>
                </div>
            </div>
        </div>
         <div class="control-group table-bordered" >
            <label class="control-label v-top"><b style="color: #f00;">*</b> {{'运输方式' | translate}} :</label>
                <a class="sui-btn btn-success" ng-click="pushcarry_mode()">{{'添加运送方式'|translate}}</a>
                <table class="sui-table table-bordered">
                    <thead>
                        <th>
                            {{'region'|translate}}
                        </th>
                        <th>
                            {{'num'|translate}}
                        </th>
                        <th>
                            {{'first_weight'|translate}}
                        </th>
                        <th>
                            {{'volume'|translate}}
                        </th>
                        <th>
                            {{'first_amount'|translate}}
                        </th>
                        <th>
                            {{'second_piece'|translate}}
                        </th>
                        <th>
                            {{'second_weight'|translate}}
                        </th>
                        <th>
                            {{'second_bulk'|translate}}
                        </th>
                        <th>
                            {{'second_amount'|translate}}
                        </th>
                        <th>
                            {{'carry_way'|translate}}
                        </th>
                        <th>
                            {{'is_default'|translate}}
                        </th>
                    </thead>
                    <tbody>
                        <tr ng-repeat="carry_mode in faretemplate.carry_modes">
                            <td>
                            <input type="text" name="" ng-model="carry_mode.regionObj.region_name"  >
                            <myarea ng-model="carry_mode.regionObj" dft="1" ></myarea>
                             <!--    <input type="hidden" ng-if="carry_mode.regionObj.id" name="region" ng-model="carry_mode.region=carry_mode.regionObj.id"> -->
                            </td>
                            <td>
                                <input type="number" name="first_piece" ng-model="carry_mode.first_piece">
                            </td>
                            <td>
                                <input type="number" name="first_weight" ng-model="carry_mode.first_weight" style="width:50px">
                            </td>
                            <td>
                                <input type="number" name="first_bulk" ng-model="carry_mode.first_bulk" style="width:50px">
                            </td>
                             <td>
                                <input type="number" name="first_amount"  ng-model="carry_mode.first_amount" style="width:50px">
                            </td>
                            <td>
                                <input type="number" name="second_piece"  ng-model="carry_mode.second_piece" style="width:50px">
                            </td>
                            <td>
                                <input type="number" name="second_weight"  ng-model="carry_mode.second_weight" style="width:50px">
                            </td>
                            <td>
                                <input type="number" name="first_bulk"  ng-model="carry_mode.first_bulk" style="width:50px">
                            </td>
                            <td>
                                <input type="number" name="second_amount" ng-model="carry_mode.second_amount" style="width:50px">
                            </td>
                            <td>
                                <!-- <input type="number" name="carry_way" ng-model="carry_mode.carry_way"> -->
                                <carryway-type ng-model="carry_mode.carry_way"></carryway-type>
                            </td>
                            <td>
                                <input type="checkbox" name="is_default" ng-model="carry_mode.is_default">
                            </td>
                        </tr>
                    </tbody>
                </table>
        </div>
        
        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <button type="submit" id="submit" class="sui-btn btn-primary" ng-disabled="!faretemplateForm.$valid">
                    <span>{{'save'|translate}}</span>
                </button>
            </div>
        </div>
    </form>
</div>
